<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>原型对象</title>
</head>

<body>
  <script>
    // ============================== 原型对象 ==============================

    function Person(name , age) {
      this.name = name
      this.age = age
    }
    Person.prototype.sayHi = function(){
      console.log('hhhhh')
    }
    // 实例化
    const zs = new Person('张三', 18)
    const ls = new Person('李四', 19)
    zs.sayHi()
    ls.sayHi()
    console.log(zs.sayHi === ls.sayHi)

  </script>
</body>

</html>